##############################################################################
# Insures that even if an error occurs in the script that the script will
# continue. Errors will still be logged.
	ignoreErrors true
##############################################################################
# 												Radiance Lighting System
# 													Internal Version 6.02 (MODIFIED)
# 														Public Version 2.2 BETA Release Candidate 1
##############################################################################

	set outsideDiffusionAmbientColor    	(1.0, 1.0, 1.0)
	set outsideFloorAmbient               0.25
	set outsideWallAmbient                0.25
	set brightWallFloorContribution       1
	set darkWallFloorContribution         0.5
	seti wallPropagationSteps 						3
	seti floorPropagationSteps 						3
	setf incidenceMapScale 								100
	setf incidenceMapHeightClamp 					1
  setf roomLightingType 								6
	set roomOverallStrength 							1
	set object:roomOverallStrength 				1.1
	set sim:roomOverallStrength 					1
  set wall:roomOverallStrength 					1
  set roomDirectionalBoost 							1
	set wall:roomDirectionalBoost  				0.8
	set object:roomDirectionalBoost 			1
	set sim:roomDirectionalBoost 					1
  setf wall:roomFromLightMapMix      		0
	setf wall:roomFromLightMapStrength 		0
	setf sim:roomFromLightMapMix      		0
	setf sim:roomFromLightMapStrength 		0
	setf object:roomFromLightMapMix      	0
	set roomBounceStrength 								.95
	set wall:roomBounceStrength 					.95
	set object:roomBounceStrength 				.95
 	set sim:roomBounceStrength 						.95
	set roomBounceCrossover 							.5
	set wall:roomBounceCrossover 					.5
	set object:roomBounceCrossover 				.5
	set sim:roomBounceCrossover 					.5
	set roomCrossBias 										.5
	set wall:roomCrossBias 								.5
	set object:roomCrossBias 							.5
	set sim:roomCrossBias 								.5
	set roomSideStrength  								0.6
	set wall:roomSideStrength  						0.6
	set object:roomSideStrength  					0.6
	set sim:roomSideStrength  						0.6
	set roomSideCrossover 								.5
	set wall:roomSideCrossover 						.5
	set object:roomSideCrossover 					.5
	set sim:roomSideCrossover 						.5
	set roomSideSlope 										0.5
	set wall:roomSideSlope 								0.5
	set object:SideSlope 									0.5
	set sim:SideSlope  										0.5
	set roomSaturation 										1
	set roomPortalStrength 								1
	set wall:roomPortalStrength 					1
	set object:roomPortalStrength 				1
	set sim:roomPortalStrength 						1
	set roomCeilingStrength 							1
	set wall:roomCeilingStrength 					1
	set object:roomCeilingStrength 				1
	set sim:roomCeilingStrength 					1
	set roomSpecular 											1
	set sim:roomSpecular 									1
	set object:roomSpecular 							1
	set wall:roomSpecular 								1
	set wallDrivenPortals 								1
	setb morningEvening 									true
	setf objectLightJitter 								0
	setf portalLightJitter 								0
	set lightRangeCutoff 									0.0
	setf spillPlaneOffset 								0.1
	setf objectLightTransitionTime 				0.01
	set portalSuppressionRadius 					3
	set portalSuppressionAmount 					0.1
  set portalCornerSuppressionAmount 		0.1
  setf portalCornerSuppressionAmount  	0.1
  seti portalCornerSuppressionAmount 		0.1
  set dayLightMapID    									0xeba01cc9
  set nightLightMapID  									0x8ba01cad
  set nhoodLightMapID  									0x0be702ef
  set testMap1ID       									0x917660c
  set testMap2ID       									0x917660d
  set gunmodnightID    									0x6fb59732
	setf hmLotShadowStrength         			1.5
	setf hmNHoodShadowStrength       			0.47
	setf hmSunLightTransitionZone    			1
	setf hmBlobWidthModifier         			0.05
	setf hmBlobHeightModifier        			0.09
	setf hmObjectShadowingBias       			0.1
	setf hmBinaryShadowThreshold     			0.99


####################################################################################
#                                         Daytime                                    
####################################################################################
lightingState day
   control -edith true
   skylight                      (.8,.8,1)  .3 # Neighborhood terrain, interior sun light; affects shadows
   light sun      (-1.2, 1.5, 1.5)    (1,1,1)     1.4 # overall sun glint color - affects neighbor objects as well
   light sky      (-1.2, 1.5, 1.5)  (.8,.8,.9)    .25 # overall sun color mixes with everything including shadows
   light fill1    (-1.2, 1, 1.5)     (.8,.8,.95)    .15  # extra sunlight coloring
   light simFill1  (-2, -0, 1.5) (.5,.5,.55)  1 # lesser light 1 RIGHT SIDE OF SUN BLUE
   light simFill2  (.5,  2, 1.5) (.55,.5,.5)  1 # lesser light 1 LEFT SIDE OF SUN RED
   light simFill3  (2,-2,1.5) (.7,.7,.75)  1 # lesser shadow on sim BLUE
   diffParam insideAmbientColor (1, 1, 1)
   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4
   modifiers insidePortals       0  1  .333  .333
   modifiers insidePortalSpills  2    1.7       .3         .4
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     0     0      1     1
   modifiers insideObjects      1.2   .5    .2     .3
   modifiers outsideObjects    .2      .25     .085 .09
   portalSaturation 1
   projectiveShadowStrength 0.73
   unlitRoomColor (0.03, 0.03, 0.035) -threshold .5
   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1 # for lighting set to low.
   environment (1,1,1)    1
   transitionTimes        1                 1
   end
lightingState dayNoPortals : day
end

###################################################################################
#                                 LOT NIGHTIME
###################################################################################
lightingState night
   control -edith true
###################################################################################
###################################################################################
# Does this work without NL? Doesnt seem to as per PatchesSim2.
# lightmapping is not a good thing to use in this mod except
# for NH views because it creates false light glows when lights are off.
# As long as you dont activate general LM functions then this function
# CAN be used in lot view to alter darkness or tint of GROUND/TERRAIN.
# Use the following formula:
# lightmap binarycallmapname -strength float < higher is brighter> -tint (R,G,B).
#
#    lightMap   0x6fb59732  -strength  .6  -tint (.33,.33,.33)
#
###################################################################################
###################################################################################
# This is shadow darkness and color for NH and LOT in LOT view.
# Formula:
# skylight (R,G,B) intensity float.
# Controls brightness through window portals on objects and diffusion.
#
   skylight       (.2,.2,.6) .15
#
###################################################################################
###################################################################################
# This can be considered the sun glint or main focus.
# Affects NH and LOT in LOT view.
# Formula:
# light sun (X is front to -back, Y is left to -Right, Z is Up or -Down).
# (R,G,B) intensity float.
# For XYZ use float values from +2 to -2.
# Does not seem to affect portal objects much.
#
   light sun (-2, -2, 2) (.3,.3,.7) .2 # 10
#
###################################################################################
###################################################################################
# This is a filler for non focused light.
# Follows same rules as light sun except:
# Does not affect NH Lot imposters.
# Does not seem to affect portal objects much.
# Does affect shadow color
# Does not affect interior objects unless they are white.
light sky (-2, -2, 2) (.3,.3,.7) .1   #2:00
#
###################################################################################
###################################################################################
# Follows light sky rules.
# Does not affect interior objects unless they are white.
   light fill1 (-2, -2, 2) 	(.3,.3,.7) .1  # 5
   light fill2 (-2, -2, 2) (.3,.3,.7) .1 # 7
#
###################################################################################
###################################################################################
# Applies ONLY to sims.
# Follows light sky rules.
   #light simFill1 (-1.8, -1.8, 2)	(.35,.35,.76) .2
   #light simFill2 (-1.8, 1.8, 2) 	(.35,.35,.76) .05
   #light simFill3 (2, 1.8, 2) 			(.35,.35,.76) .025
#
###################################################################################
###################################################################################
# Ties in with Floor and Wall Ambiant.
# Formula: (R,G,B)
#
   diffParam insideAmbientColor (1, 1, 1)
# Modify these and die!
# Formula: float.
#
   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4
#
###################################################################################
###################################################################################
# Do not put Pract at > 0 because of Maxis error that causes newspapers,
# pillows, etc to glow bright green when moved.
# Formula:
# A = Practical Bright B = Diffuse Bright.
# C = Practical Falloff C= Diffuse Falloff.
   modifiers insidePortals       0  1  .333  .333
#
###################################################################################
###################################################################################
# Formula:
# A = Practical Bright B = Diffuse Bright.
# C = Practical Falloff C= Diffuse Falloff.
   modifiers insidePortalSpills  2 1.7  .3   .4
#
###################################################################################
###################################################################################
# Not needed.
# Relies on outsidePortalSpills instead.
# As with InsidePortals do not set A > 0.
# Formula:
# A = Practical Bright B = Diffuse Bright.
# C = Practical Falloff C= Diffuse Falloff.
   modifiers outsidePortals      0  0  1    1
#
###################################################################################
###################################################################################
# Sets amount of light that spills outside from interior light.
# Lights more than 5 tiles from window do not spill light outside.
# Also removed outside window edge glow.
# Formula:
# A = Practical Bright B = Diffuse Bright.
# C = Practical Falloff C= Diffuse Falloff.
   modifiers outsidePortalSpills     3     6      .65     0.8
#
###################################################################################
###################################################################################
# Controls how bright items are lit by interior lights.
# Formula:
# A = Practical Bright (Objects, Sims) B = Diffuse Bright.
# C = Practical Falloff (Walls, Floors) C= Diffuse Falloff.
   modifiers insideObjects      1.2   .5    .2     .3
#
###################################################################################
###################################################################################
# Controls how bright items are lit by
# exterior lights.
# Formula:
# A = Practical Bright (Objects, Sims) B = Diffuse Bright.
# C = Practical Falloff (Walls, Floors) C= Diffuse Falloff.
   modifiers outsideObjects     .5   .45    .085   .09
#
###################################################################################
###################################################################################
# Controls light influence of OUTSIDE going INTO
# inside window light. Lower numbers make
# brighter window interior spills. A float
   portalSaturation 1
#
###################################################################################
###################################################################################
# Controls darkness of high detail shadows.
# Sims, objects shadows. Higher numbers
# make darker shadows. A float
   projectiveShadowStrength .5
#
###################################################################################
###################################################################################
# Controls non lit objects, rooms, sims total ambiant light.
# Formula:
# (R,G,B) -threshold float
# Threshold determines how much introduced light there must be
# before ambiant light takes over.
   unlitRoomColor (0.1, 0.1, 0.1) -threshold .5
#
###################################################################################
###################################################################################
# for lighting set to low.
# not used by this mod because
# this mod requires of the used
# of high detail light.
   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1
#
###################################################################################
###################################################################################
# Controls several factors.
# Formula:
# (R,G,B) float intensity
# Controls lighting color of LOT view of NH, also controls reflective
# power of reflective objects placed outside. (Like Cars).
# This value should match the corresponding NH lightstate enviroment.
   environment (.2, .2, .45)    1
#
###################################################################################
###################################################################################
# Assuming UI means User Interface
# also Assumes it was meant to color
# the user interface at different times
# of day. Testing has not seen any results.
   UIShade (1, 1, 1) 1
#
###################################################################################
###################################################################################
# Controls length of time between time of day changes
# Formula:
# min time interger  max time interger
# Seems no matter what is set it takes Lot 5 seconds to change
   transitionTimes        1                1
end
lightingState nightNoPortals : night
end
###################################################################################
#                                 LOT MORNING                                        
###################################################################################
lightingState morning
   control -edith true
   skylight       (.7,.3,.5) .15
   light sun (0, -2, 2) (.8,.4,.6) .15 # 10
   light sky (0, -2, 2) (.8,.4,.6) .04   #2:00
   light fill1 (0, -2, 2) 	(.8,.4,.6) .015  # 5
   light fill2 (0, -2, 2) (.8,.4,.6) .005  # 7
   #light simFill1 (-1.8, -1.8, 2)	(.35,.35,.76) .2
   #light simFill2 (-1.8, 1.8, 2) 	(.35,.35,.76) .05
   #light simFill3 (2, 1.8, 2) 			(.35,.35,.76) .025
   diffParam insideAmbientColor (1, 1, 1)
   diffParam insideFloorAmbient 0.03
   diffParam insideWallAmbient  0.03
   diffParam floorThreshold     .6
   diffParam wallThreshold      .4
   modifiers insidePortals       0  1  .333  .333
   modifiers insidePortalSpills  2  1.7  .3   .4
   modifiers outsidePortals      0  0  1    1
   modifiers outsidePortalSpills     2     4      .65     1
   modifiers insideObjects      2   .5    .2     .3
   modifiers outsideObjects     .4   .35    .085   .09
   portalSaturation 1
   projectiveShadowStrength .6
   unlitRoomColor (0.03, 0.03, 0.035) -threshold .5
   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1
   environment (.45, .3, .43)    1
   UIShade (1, 1, 1) 1
   transitionTimes        1                1
end


####################################################################################
#                                         EVENING                                       # To Do
####################################################################################
lightingState evening
	 # lightMap   $nhoodLightMapID -strength 1
   control -edith true
   skylight                      (.8,.45,.45)  .4 # Neighborhood terrain, interior sun light; affects shadows
   light sun      (-2, 1.5, 1)    (.8,.5,.5)     1.5 # overall sun glint color - affects neighbor objects as well
   light sky      (-2, 1.5, 1)  (.7,.4,.4)    .25 # overall sun color mixes with everything including shadows
   light fill1    (-2, 1, 1)     (.75,.4,.4)    .15  # extra sunlight coloring
   light simFill1  (-2, -0, 1) (.33,.1,.1)  1 # lesser light 1 RIGHT SIDE OF SUN BLUE
   light simFill2  (.5,  2, 1) (.33,.1,.1)  1 # lesser light 1 LEFT SIDE OF SUN RED
   light simFill3  (2,-2,1) (.44,.3,.3)  1 # lesser shadow on sim BLUE
   diffParam insideAmbientColor       (1, 1, 1)
   diffParam insideFloorAmbient         0.03
   diffParam insideWallAmbient          0.0001
   diffParam floorThreshold           .9
   diffParam wallThreshold            .6
   modifiers insidePortals       0      1       .333       .333
   modifiers insidePortalSpills  2      1.7      .3     .4  #### check after incremental
   modifiers outsidePortals      0      0          1           1
   modifiers outsidePortalSpills 1.5      3          0.65           1.3
   modifiers insideObjects      1.2      .5        .2     .3
   modifiers outsideObjects    .25    .25     .085     .09
   portalSaturation 1
   projectiveShadowStrength 0.7
   unlitRoomColor (0.1, 0.1, 0.1) -threshold .9
   flatShade (1, 1, 1) 1  -sims 1 -objects 1 -indoors 1 # for lighting set to low.
   environment (.8,.45,.45)    1
   transitionTimes        1                 1
end


###############################################################################
###############################################################################
# Neighbourhood                                                # Do not modify!
###############################################################################
###############################################################################
lightingState neighbourhood
  skylight                      (.87,.925,1)  .25
   light sun      (1.75, -2, 1.5)    (1, .9, .8) 1.75
   light sky      (-2, 1.75, 2)  (0.7,.75,.8)   .5
   light fill1    (0, 0, 1)     (1,1,1)     0.25
   lightMap   $nhoodLightMapID
   diffParam insideAmbientColor       (1, .95, .75)
   diffParam insideFloorAmbient        .15
   diffParam insideWallAmbient         .25
   diffParam floorThreshold            0.154
   diffParam wallThreshold             0.12
   modifiers insidePortals       3      3.8        0.8         .9
   modifiers insidePortalSpills  3      4          .8         1.3
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1
   modifiers insideObjects     1       1         2        1
   modifiers outsideObjects    0.5     1         4         2
   unlitRoomColor (0.01, 0.01, 0.01)
   flatShade (1, .95, .85) .75  # for lighting quality 0
   environment (1,1,1)    1
end

lightingState neighbourhoodNoPortals : neighbourhood
   lightMap $nhoodLightMapID
   skylight                      (.87,.925,1)  .25
   light sun      (1.75, -2, 1.5)    (1, .9, .8) 1.75
   light sky      (-2, 1.75, 2)  (0.7,.75,.8)   .5
   light fill1    (0, 0, 1)     (1,1,1)     0.25
   lightMap 0x0be702ef
   diffParam insideAmbientColor       (1, .95, .75)
   diffParam insideFloorAmbient        .15
   diffParam insideWallAmbient         .25
   diffParam floorThreshold            0.154
   diffParam wallThreshold             0.12
   modifiers insidePortals       3      3.8        0.8         .9
   modifiers insidePortalSpills  3      4          .8         1.3
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1
   modifiers insideObjects     1       1         2        1
   modifiers outsideObjects    0.5     1         4         2
   unlitRoomColor (0.01, 0.01, 0.01)
   flatShade (1, .95, .85) .75  # for lighting quality 0
   environment (1, 1, 1) 1.0  # override environment lighting state
end
# Used to generate imposters from lot houses.
lightingState neighbourhoodImposter : neighbourhood
 skylight                      (.87,.925,1)  0.5
   light sun      (-2, -2, 1.5)  (1, .9, .8) 1.5
   light sky      (2, 2, 2)  (.7,.75,.8)   .35
   light fill1    (0,0,1)   (1,1,1)     .25
   lightMap  0 # disable light map
   diffParam insideAmbientColor       (.75, .75, .75)
   diffParam insideFloorAmbient         0.001
   diffParam insideWallAmbient          0.001
   diffParam floorThreshold            .4
   diffParam wallThreshold             .4
   portalSaturation 1
   modifiers insidePortals       1.25 1.25           .5          .5
   modifiers insidePortalSpills  1.25 1.25           .5          .5
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1
   modifiers insideObjects     .9        .75    .33  0.5
   modifiers outsideObjects    .25       .25         0.85 0.9
   unlitRoomColor (.275, .275, .275) -threshold .33
   UIShade (1, 1, 1) 1
   flatShade (1, .95, .85) 0.7  # for lighting set to low.
   environment (1, 1, 1) 1
end
# For testing only.
lightingState neighbourhoodHiC
   light sun   (-0.5,  1, 0.5)   (.9, .855, .8)    4
   light sky   ( 0.5, -1, 0.5)   (.8, .8, 1)       .5
   light fill1 (-1, -1, -1)      (1, 1, 0.75)      0.75
   light fill2 (-1, 1, -.5)      (0.6, 0.5, 0.45)  0.5
   lightMap $testMap1ID
end
###############################################################################
#                    Added from Nightlife text for all EP's
###############################################################################
lightingState neighborhoodnight
   skylight                         (0.2, 0.2, 1)     .3
  light sun      (-1.5, -1,  2)    (.45, .45, 1)      1
   lightMap   0x6fb59732
   diffParam insideAmbientColor       (1, .95, .75)
   diffParam insideFloorAmbient        .15
   diffParam insideWallAmbient         .25
   diffParam floorThreshold            0.154
   diffParam wallThreshold             0.12
   modifiers insidePortals       3      3.8        0.8         .9
   modifiers insidePortalSpills  3      4          .8         1.3
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1
   modifiers insideObjects     1       1         2        1
   modifiers outsideObjects    0.5     1         4         2
   unlitRoomColor (0.01, 0.01, 0.01)
   flatShade (.3, .35, .9) .5  # for lighting quality 0
   environment (0.5, 0.5, 1) 0.65  # override environment lighting state
end
###############################################################################
#                           END OF NEIGHBORHOODS
###############################################################################
# CAS
###############################################################################
lightingState CAS
   skylight                      (.87,.925,1)  0.3
   light sun      (1.5, 1, 2)    (1, .94, .875)      1
   light sky      (-1.5, -1, 2)  (.8,.8,.8)    .5
   light fill1    (1, 1, 1)     (1,1,1)    .5
   diffParam insideAmbientColor       (0,0,0)
   diffParam insideFloorAmbient         0.001
   diffParam insideWallAmbient          0.001
   diffParam floorThreshold            .25
   diffParam wallThreshold             .25
   portalSaturation 1
   modifiers insidePortals       1    0.75           .8        1
   modifiers insidePortalSpills  0   .25           .65          1
   modifiers outsidePortals      0       0          1           1
   modifiers outsidePortalSpills 0       0          1           1
   modifiers insideObjects     1    .75   .33    .4
   modifiers outsideObjects    0       0         1 1
   unlitRoomColor (.175, .142, .1) -threshold .175
   unlitRoomColor (.2, .172, .15) -threshold .175
   UIShade (1, 1, 1) 1
   flatShade (1, .95, .85) 0.7  # for lighting set to low.
   environment (1, 1, 1) 1
end
###############################################################################
# Debugging
#

lightingState test
   light sun      (1, 0, 0)   (1, 0, 0)  1
   light sky      (0, 1, 0)   (0, 1, 0)  1
   light fill1    (0, 0, 1)   (0, 0, 1)  1
   light fill2    (-1, -1, -1)   (1, 1, 0) 1
   diffParam insideAmbientColor       (1, 1, 1)
   diffParam insideFloorAmbient        0
   diffParam insideWallAmbient         0.0
   diffParam floorThreshold            0.1
   diffParam wallThreshold             0.1
   modifiers insidePortals 0 0
   modifiers outsidePortals 0 0
   modifiers insideObjects 0 0
   modifiers outsideObjects 0 0
   UIShade (0, 0, 0) 0
   environment (1, 0, 1)
end

lightingState debugObjects
   diffParam insideAmbientColor       (.8, .75, .75)
   diffParam insideFloorAmbient         .1
   diffParam insideWallAmbient          .2
   diffParam floorThreshold            0.154
   diffParam wallThreshold             0.12
   modifiers insideObjects     1       1          1           1
   modifiers outsideObjects    1       1          1           1
   environment (0, 0, 0)
end

lightingState debugObjectSeeds : debugObjects
   modifiers insideObjects     0       1          1           100
   modifiers outsideObjects    0       1          1           100
end

lightingState debugPortals
   control -debugPortals true
   light sun      (-1, 0, 0)  (0, 0, 0)
   light sky      (1, 0, 0)   (0, 0, 0)
   light fill1    (0, 0, -1)  (0, 0, 0)
   light fill2    (0, 0, 1)   (0, 0, 0)
   diffParam insideAmbientColor       (1, 1, 1)
   diffParam insideFloorAmbient        0
   diffParam insideWallAmbient         0
   diffParam floorThreshold            10
   diffParam wallThreshold             1
   modifiers insidePortals  1000 2
   modifiers outsidePortals 1000 2
   modifiers insidePortalSpills  0 0
   modifiers outsidePortalSpills 0 0
   modifiers insideObjects  0 0
   modifiers outsideObjects 0 0
   environment (0, 0, 0)
end

lightingState debugPortalSpills
   control -debugPortals true
   light sun      (-1, 0, 0)  (0, 0, 0)
   light sky      (1, 0, 0)   (0, 0, 0)
   light fill1    (0, 0, -1)  (0, 0, 0)
   light fill2    (0, 0, 1)   (0, 0, 0)
   diffParam insideAmbientColor       (1, 1, 1)
   diffParam insideFloorAmbient        0
   diffParam insideWallAmbient         0
   diffParam floorThreshold            10
   diffParam wallThreshold             1
   modifiers insidePortalSpills  1000 2
   modifiers outsidePortalSpills 1000 2
   modifiers insidePortals  0 0
   modifiers outsidePortals 0 0
   modifiers insideObjects  0 0
   modifiers outsideObjects 0 0
   environment (0, 0, 0)
end

lightingState mat000
   skylight                     (0, 0, 0)
   flatShade                    (0, 0, 0)
   environment                  (0, 0, 0)
   diffParam insideAmbientColor (0, 0, 0)
   diffParam insideFloorAmbient         0.5
   diffParam insideWallAmbient          1
   modifiers insidePortals       0       0
   modifiers outsidePortals      0       0
   modifiers insidePortalSpills  0       0
   modifiers outsidePortalSpills 0       0
   modifiers insideObjects       0       0
   modifiers outsideObjects      0       0
end

define matState(pct)
   set shade (&pct / 100)
   lightingState mat&{pct} : mat000
      skylight                     ($shade, $shade, $shade)
      flatShade                    ($shade, $shade, $shade)
      environment                  ($shade, $shade, $shade)
      diffParam insideAmbientColor ($shade, $shade, $shade)
   end
enddef

create matState(050)
create matState(100)
create matState(150)
create matState(200)
create matState(300)
create matState(400)


############################################################################### Needs more work
# External lighting
#
# Strength of outdoor lighting for walls/objects.
# Ideally these would both be 1, and our object
# materials would all be tuned to look consistent
# with such lighting. But that's not
# the case at the moment.
setf outdoorStrength 1
# terrain strength is currently specified separately.
setf terrainStrength 1

###############################################################################
# Light map parameters
#
# Don't touch unless you know what you're doing.
# these are actually page sizes
# DO NOT CHANGE
# CRASHES GAME
seti floorTextureSize 512
seti wallTextureSize 256
# 4/8 triggers direct guard tile->texture mapping.                               Needs more work
# Otherwise, need y = 3 * x.
seti wallTileSizeX 8
seti wallTileSizeY 24
setb lightMapDebug false
###############################################################################
####################################################
# Lighting overrides
#

####################################################
# Support for Real Light System Added by GunMod
#
include "RLS-Main.txt"

####################################################
# Support for Custom Lights added by the CEP3
#
wildInclude "CEP3_CustomLights/*.nlo"